package io.framework.modules.security.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * /**
 * 〈本地文件上传〉
 *
 * @Author GJQ
 * @Create 2020/5/9
 * @Since 1.0.0
 */

@Configuration
public class WebMvcConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //addResourceHandler是指你想在url请求的路径
        //addResourceLocations是图片存放的真实路径
        //windows  文件上传  linux需要修改地址
        registry.addResourceHandler("/fileupload/**").addResourceLocations("file:E:\\upload\\");
        super.addResourceHandlers(registry);
    }

}

